import pytest, time
from selenium.webdriver.common.by import By


class ProductWafLocator:
    """
      Security 页面
     """
    # security_page
    security_page = (By.CSS_SELECTOR, '[class="antd4-tabs-tab-btn"]')
    # Create New
    # waf_createnew_button = (By.XPATH,'(//button[@class="antd4-btn antd4-btn-primary"])[1]' )
    waf_createnew_button = (By.XPATH, '//*[@id="rc-tabs-1-panel-451"]/div/div/div/form/div[1]/div/div/div/div/button/span[1]')

    # 标题Billing Method & Region   (//div[@class="base-card-title___qDYiK"])[1]
    billing_method_region_title = (By.XPATH,'(//*[@id="creForm"]/div[1]/div[1]/div[2])' )
    # 标题Billing Method按钮  //*[@id="creForm_billingMethod"]/div/div/div/label/span[2]    (//span[@class="antd4-radio-button-inner"])[1]
    billing_method_button = (By.XPATH, '//*[@id="creForm_billingMethod"]/div/div/label/span[2]')
    # 标题Region and Zone项默认值
    region_zone_key = (By.XPATH, '(//div[@class="antd4-space-item"])[2]/div/label/span[2]')
    # 标题Validity Period配置参数1month
    validity_period_1month = (By.XPATH, '//*[@id="creForm_period"]/div/div[1]/div/label/span[2]')
    # Estimated Costs 1month 金额
    estimated_costs_1month = (By.XPATH,'//*[@class="cre-container-footer-primary"]/div/div/span/span')
    # 同意协议按钮   //*[@id="root"]/section/main/div[2]/div[1]/div/div/div/div/div[1]/div[2]/div/div/div/div[2]/div/div[2]/div/div[2]/label/span
    agree_bug_button = (By.XPATH, '//*[@class="agreementItem___13tgJ"]/label/span')
    # 购买按钮
    bug_now_button = (By.XPATH,'//*[@class="cre-container-footer-primary"]/button')

    # payment页面
    waf_payment_page = (By.XPATH,'//*[@id="root"]/section/main/div[2]/div[1]/div/div/div/div')
    # payment页面的计算1个月的金额
    waf_total_payment = (By.XPATH,'//*[@class="cre-container-footer-primary"]/div/div/span/span')
    # payment页面支付按钮
    waf_pay_button = (By.XPATH,'//*[@id="root"]/section/main/div[2]/div[1]/div/div/div/div/div[2]/div[2]/button/span')
    # 支付成功页面提示语 //*[@id="root"]/section/main/div[2]/div[1]/div/div/div/div/div/div/div/div[2]
    pay_susseccful_tips = (By.XPATH,'//*[@id="root"]/section/main/div[2]/div[1]/div/div/div/div/div/div/div/div[2]')
    # check order按钮
    waf_checkorder_button = (By.XPATH,'//*[@id="root"]/section/main/div[2]/div[1]/div/div/div/div/div/div/div/div[4]/button[1]/span')
    # open console按钮
    waf_openconsole_button = (By.XPATH, '//*[@id="root"]/section/main/div[2]/div[1]/div/div/div/div/div/div/div/div[4]/button[2]/span')
    # order页面
    order_page = (By.XPATH,'//*[@id="root"]/section/section/main/div/main/div/div/div/div[1]/div/div/span/div/div[1]/div')
    # WAF控制页面
    waf_control_page = (By.XPATH, '//*[@id="root"]/section/section/aside/div/div[1]')




    # ifarme
    iframe = (By.CSS_SELECTOR, '[id="hj_container"]')
    # 用于检查Web Application Firewall文本
    check_waf_page = (By.XPATH, '(//div[@class="antd4-space-item"])[1]/div')


    # WAF购买页domain的？按钮
    waf_help_button = (By.XPATH,'//*[@id="creForm"]/div[2]/div[2]/div/div[1]/label/div/div[2]/div/span')
    # WAF购买页domain的？按钮提示语/html/body/div[3]/div/div/div/div[2]/div   (//div[@class="antd4-tooltip-inner"])[1]/div
    waf_help_button_tips = (By.XPATH,'(//div[@class="antd4-tooltip-inner"])[1]/div')

    #